{%mainunit bitcoin_p2p.pas}

{$IFDEF INTERFACE}
type
  { TP2PHeader is proceding all P2P messages, its most important
    purpose is to tell us how many more bytes to read from the socket
    until we can check the checksum and start parsing. Note that due
    to backward compatibility there is an ugly exception from the rule,
    the very first message, the version message, and the verack message
    are always sent with a shorter header without the checksum field.
    The ReadHeaderFromSocket() function will take care of this. }
  TP2PHeader = packed record
    Magic : array[0..3] of Byte;
    Command: Tp2pCommand; //  12 bytes null-padded command string
    Length: DWord;
    CheckSum: TCheckSum;  // last 4 bytes of sha256(sha256(msg)))
  end;

{$ENDIF}
{$IFDEF IMPLEMENTATION}


{$ENDIF}
